/**
 * Created by wengms on 2016/11/24.
 */
/**
 * 计算hash
 */
define([], function () {
    return function hash(str) {
        var h = 0;
        var len = str.length;
        var t = 2147483648;
        for (var i = 0; i < len; i++) {
            h = 31 * h + str.charCodeAt(i);
            if(h > 2147483647) h %= t;//java int溢出则取模
        }
        return h;
    }
});